//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月16日   下午10:37:46
 */
package edu.chinasoft.domain;

import java.util.ArrayList;
import java.util.List;

public class PageUtilForDept {
	private List<Dept> userList = new ArrayList<Dept>();
	private int pageUtil; // 分页单位
	private int pageNum; // 总页数
	private int recordNum; // 总记录数
	private int currentPage; // 当前页面
	public PageUtilForDept() {
		super();
		// TODO Auto-generated constructor stub
	}
	public PageUtilForDept(List<Dept> userList, int pageUtil, int pageNum, int recordNum, int currentPage) {
		super();
		this.userList = userList;
		this.pageUtil = pageUtil;
		this.pageNum = pageNum;
		this.recordNum = recordNum;
		this.currentPage = currentPage;
	}
	public List<Dept> getUserList() {
		return userList;
	}
	public void setUserList(List<Dept> userList) {
		this.userList = userList;
	}
	public int getPageUtil() {
		return pageUtil;
	}
	public void setPageUtil(int pageUtil) {
		this.pageUtil = pageUtil;
	}
	public int getPageNum() {
		return pageNum;
	}
	public int setPageNum(int pageNum) {
		pageNum = (this.recordNum - 1) / this.pageUtil + 1;
		return pageNum;
	}
	public int getRecordNum() {
		return recordNum;
	}
	public void setRecordNum(int recordNum) {
		this.recordNum = recordNum;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getPrePage() {
		int result = this.currentPage - 1;
		result = result >= 1 ? result : 1;

		return result;
	}

	public int getNextpage() {
		int result = this.currentPage + 1;
		result = result <= this.getPageNum() ? result : this.getPageNum();

		return result;
	}
	
}
